function my_exportFig(f,fig_path,FileType,Resolution,opt)
% my_exportFig(f, path, FileType, Resolution)
% ------------------------------------------
% Description:
% 	export figure, using print or exportgraphics
% Input:
% 	f: fig handle
% 	path, string, name of path, without suffix
% 	FileType: same to print, "-dtiff","-djpeg","-dpng"
% 	Resolution: double
% 	opt:
% 		"Edge": true or false, with or without edge
% 		"Decorate": true or false, with or without my_decorateFig funciton
% Output:
% 	figure save to file
% Author: Sid Chen (cnqdcyq@163.com)
% Log:
% 	2022/08/24 created
	arguments
		f
		fig_path string
		FileType string = "-dtiff"
		Resolution double = 300
		opt.Edge = true
		opt.Decorate = true
	end

	if opt.Decorate
		f2 = my_decorateFig(f);
	else
		f2 = f;
	end

	if opt.Edge
		print(f2,fig_path,FileType,sprintf("-r%d",Resolution));
	else
		FileType = char(FileType);
		FileType = FileType(3:end);
		fig_path = strcat(fig_path,'.',FileType);
		exportgraphics(f2,fig_path,'Resolution',Resolution);
	end
end
